<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author kaige <[<yucong.tang@zhaopin.com.cn>]>
 * @date(2017.9.18)
 *
 * 功能业务接口
 */

class Feauitinterface_kaige extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->model('comon_model');
		
		// $this->load->helper('url');
		// $this->load->library('session');
	}

	/**
	 * 默认路由
	 * @return [type] [description]
	 */
	function index()
	{
		echo json_encode(array('status' => 0));
	}

	/**
	 * 核心路由
	 * @return [type] [description]
	 */
	function worker_routes()
	{
		// 方法选择
		$jump = $this->input->get_post('jump',TRUE);

		switch ($jump) {

			case 'example':

				//权限判断
				if($this->comon_model->_userpower("0404000") < 0)
					die('{"status":-600}');
				$this->example($this->input);
				break;

			default:
				echo json_encode(array('status' => 0));
				break;
		}
	}

	/**
	 * example的处理
	 * @param  [type] $inputs [description]
	 * @return [type]         [description]
	 */
	private function example($inputs)
	{
		$commonds = $inputs->post();

		switch ($commonds['commonds']) {

			// 添加滞后事件
			case 'example':
				echo json_encode($this->order_model->behind_add($commonds));
				break;

			default:
				echo json_encode(array('status' => 0));
				break;
		}
	}

}
